
export default {
    install: function (app) {
        app.directive('note', function (el) {
            let str = el.innerHTML;
            let rep1 = el.innerHTML.match(/^\s*/)[0];
            let rep2 = el.innerHTML.match(/([\r\n])\s*/)[0];
            let reg2 = new RegExp(rep2, "g")
            str = str.replace(reg2, "\n")
            let reg1 = new RegExp(rep1, "g")
            str = str.replace(reg1, "")
            str = str.replace(/[\r\n]\s*$/, "")
            str = str.replace(/^[\r\n]\s*/, "")
            el.innerHTML = str;
        });
    }
}